#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>



MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    _login_dlg = new LoginDialog(this);
    setCentralWidget(_login_dlg);
    //_login_dlg->show();



    _reg_dlg = new RegisterDialog(this);
    //创建和注册消息链接
    connect(_login_dlg,&LoginDialog::SwitchRegister,this,&MainWindow::SlotSwitchReg);


    //设置窗口为自定义且无边框的窗口
    _login_dlg->setWindowFlags(Qt::CustomizeWindowHint| Qt::FramelessWindowHint);
    _reg_dlg->setWindowFlags(Qt::CustomizeWindowHint| Qt::FramelessWindowHint);
    _reg_dlg->hide();
}


MainWindow::~MainWindow()
{
    delete ui;

}

void MainWindow::SlotSwitchReg(){
    setCentralWidget(_reg_dlg);
    _login_dlg->hide();
    _reg_dlg->show();
}

